#include "udp_server.hpp"
#include <memory>

static void usage(std::string proc)
{
    std::cout << "\nUsage: " << proc << " ip prot\n " << std::endl;
}
int main(int argc, char* argv[])
{

    if(argc != 2)
    {
        usage(argv[0]);
        exit(2);
    }

    // std::string ip = argv[1];//不推荐使用确定的ip
    uint16_t port = atoi(argv[1]);

    std::unique_ptr<UdpServer> svr(new UdpServer(port));
    
    svr->InitServer();
    svr->Start();
    return 0;
}